<a href="https://www.example.com" onclick="go()">访问示例网站</a>

<script>
function go() {
  window.location.href = "https://www.example.com";
}
</script>
